package com.example.demo.threadTest;

import java.util.concurrent.Callable;

/**
 * @author leiliang
 * @version 1.0
 * @Description
 * @date 2022/8/12 15:22
 */
public class MyThreadCallable implements Callable<Integer> {

    private  String name;
    public MyThreadCallable(String name) {
        this.name = name;
    }

    @Override
    public Integer call() throws Exception {
        Integer sum = 0;
        for(int i = 0 ; i < 10;i++) {
            System.out.println(this.name + i);
            sum += i;
        }
        return sum;
     }
}
